<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }
    div {
      width: 400px;
      height: 300px;
      border:2px solid red;
      text-align: center;
      /* line-height: 100px; */

      display:table-cell;
      vertical-align: middle;
    }
  </style>
   
</head>
<body>
  <div>
    <p>文字1</p>
    <p>文字2</p>
    <p>文字3</p>
  </div>
</body>
</html>